/**
 * @(#)GreeTerImpl.java, 2019/1/7
 * <p/>
 * Copyright 2019 Netease, Inc. All rights reserved.
 * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.chengzhi.netty.grpc;

import com.chengzhi.netty.grpc.GreeterGrpc.GreeterImplBase;
import io.grpc.stub.StreamObserver;

/**
 * @author 阮承志(wb.ruanchengzhi @ mesg.corp.netease.com)
 **/
public class GreeTerImpl extends GreeterImplBase {

    @Override
    public void sayHello(HelloRequest request, StreamObserver<HelloResponse> responseObserver) {
        System.out.println(request.getName() + " " + request.getAge());
        responseObserver.onNext(HelloResponse.newBuilder().setCode(200).setName("response").build());
        responseObserver.onCompleted();
    }
}
